<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加商品</title>
    <link rel="stylesheet" href="/layui/css/layui.css">
    <script src="/layui/src/layui.js"></script>
    <script src="/layui/src/jquery-3.2.1.min.js"></script>

    <script src="/js/utils.js"></script>

    <link rel="stylesheet" href="css/ProductAdd.css">
    <script type="text/javascript" src="js/ProductAdd.js"></script>
</head>
<body>
<div class="layui-container" id="div_div_id">
    <!--头部-->
    <div class="layui-row" id="List_Header">
        <div class="layui-col-xs11 layui-col-sm11 layui-col-md11 layui-col-lg11">
            <span id="color_id">▉</span>
            <span id="List_Header_span">添加商品</span>
        </div>
        <div class="layui-col-xs1 layui-col-sm1 layui-col-md1 layui-col-lg1">
            <button type="button" class="layui-btn layui-btn-sm" onclick="go()" id="btn_bt">
                <i class="layui-icon layui-icon-left"></i> 返回
            </button>
        </div>
    </div>
    <!--表单-->
    <form class="layui-form "  id="form_id">
        <!--图片-->
       <!-- <div id="img_div">
            <img src="../img/ProductAdd.png" id="ProductAddImg"/>
        </div>-->
        <div id="div_id">
            <!--商品分类-->
            <div class="layui-form-item">
                <label class="layui-form-label">商品分类：</label>
                <div class="layui-input-block">
                    <input type="text" name="categoryName" required lay-verify="required"  autocomplete="off" class="layui-input" disabled="disabled" id="categoryId"/>
                    <input type="hidden" name="categoryId" required lay-verify="required"  autocomplete="off" class="layui-input"  id="id"/>
                    <img src="../img/icon27.gif" width="20px" height="20px" id="icon27_id" onclick="addProductCategory()"/>
                </div>
            </div>
            <p id="p_id">您当前选择的商品类别是：<span></span></p>

            <!--商品名称-->
            <div class="layui-form-item">
                <label class="layui-form-label">商品名称：</label>
                <div class="layui-input-block">
                    <input type="text" name="productName" required lay-verify="required"  autocomplete="off" class="layui-input" ID="productName"/>
                </div>
            </div>

            <!--商品图片-->
            <div class="layui-form-item" id="upload_div">
                <label class="layui-form-label">商品图片：</label>
                <div class="layui-input-block">
                    <button type="button" class="layui-btn" id="upload_btn">上传图片</button>
                </div>
            </div>
            <!--获取商品主图-->
            <input type="hidden" id="mainImage" name="mainImage" class="layui-input"/>
            <!--预览图-->
            <div class="layui-form-item" id="img_div2">
                <label class="layui-form-label">预览图：</label>
                <div id="img_div3">
                    <div class="layui-input-block" id="img_div4">
                        <i class="layui-icon layui-icon-up" id="up" onclick="upUploadImg()"></i>
                    </div>
                </div>
            </div>



            <!--商品介绍-->
            <div class="layui-form-item">
                <label class="layui-form-label">商品介绍：</label>
                <div class="layui-input-block">
                    <textarea class="layui-textarea textarea" name="productDescription" id="product_description" placeholder="请输入内容"></textarea>
                </div>
            </div>

            <!--商品标签-->
            <div class="layui-form-item">
                <label class="layui-form-label">商品标签：</label>
                <div class="layui-input-block">
                    <textarea class="layui-textarea textarea" name="productLabel" id="product_description2" placeholder="请输入标签"></textarea>
                </div>
            </div>

            <!--商品货号-->
            <div class="layui-form-item">
                <label class="layui-form-label">商品货号：</label>
                <div class="layui-input-block">
                    <input type="text" name="productCode" required lay-verify="required"  name="productCode" autocomplete="off" class="layui-input" oninput = "value=value.replace(/[^\d]/g,'')"/>
                </div>
            </div>
            <!--商品售价-->
            <div class="layui-form-item">
                <label class="layui-form-label">商品售价：</label>
                <div class="layui-input-block">
                    <input type="text" name="currentpriceProduct" required lay-verify="required" name="currentpriceProduct" autocomplete="off" class="layui-input" onkeyup="value=value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g,'')"/>
                </div>
            </div>
            <!--搜索关键字-->
            <div class="layui-form-item">
                <label class="layui-form-label">关键字：</label>
                <div class="layui-input-block">
                    <input type="text" name="searchKeywords" required lay-verify="required" name="currentpriceProduct" autocomplete="off" class="layui-input" />
                </div>
            </div>
            <!--审核状态-->
            <div class="layui-form-item" hidden>
                <label class="layui-form-label">审核状态：</label>
                <div class="layui-input-block">
                    <input type="text" name="productSate" required lay-verify="required"  autocomplete="off" class="layui-input" value="2" oninput = "value=value.replace(/[^\d]/g,'')"/>
                </div>
            </div>
            <!--商品状态-->
            <div class="layui-form-item" hidden>
                <label class="layui-form-label">商品状态：</label>
                <div class="layui-input-block">
                    <input type="text" name="state" required lay-verify="required"  autocomplete="off" class="layui-input" value="2" oninput = "value=value.replace(/[^\d]/g,'')"/>
                </div>
            </div>
            <!--商品推荐-->
            <div class="layui-form-item radio_class">
                <label class="layui-form-label">商品推荐：</label>
                <div class="layui-input-block">
                    <input type="radio" name="recommend" value="2" title="新品" checked="checked"/>
                    <input type="radio" name="recommend" value="3" title="推荐"/>
                </div>
            </div>

            <!--可用优惠券-->
            <div class="layui-form-item radio_class">
                <label class="layui-form-label" id="radio_id"> 可用优惠券：</label>
                <div class="layu    i-input-block" >
                    <input type="radio" name="discount" value="3" title="否"/>
                    <input type="radio" name="discount" value="2" title="是" checked="checked"/>
                </div>
            </div>
            <!--服务保证-->
            <div class="layui-form-item radio_class">
                <label class="layui-form-label">服务保证：</label>
                <div class="layui-input-block">
                    <input type="radio" name="ensure" value="2" title="无忧退货" checked="checked"/>
                    <input type="radio" name="ensure" value="3" title="快速退款"/>
                    <input type="radio" name="ensure" value="4" title="免费包邮"/>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block" id="btn_id">
                    <button class="layui-btn" lay-submit lay-filter="formDemo">完成，提交商品</button>
                </div>
            </div>
        </div>
    </form>
</div>
<!--预览图点击计数-->
<input type="hidden" id="num"/>


</body>
</html>